#include <iostream>

using namespace std;

string s, t;

int main()
{
	cin >> s;
	getchar();
	getline(cin, t);
	s = " " + s + " ";
	for(int i = 0; i < s.size(); i++)
	{
		if(isupper(s[i])) s[i] = tolower(s[i]);
	}
	t = " " + t + " ";
	for(int i = 0; i < t.size(); i++)
	{
		if(isupper(t[i])) t[i] = tolower(t[i]);
	}
	if(t.find(s) == -1)
	{
		cout << -1 << endl;
		return 0;
	}
	else
	{
		int f = t.find(s);
		int pos = f + 1, cnt = 1;
		while(t.find(s, pos) != -1)
		{
			pos = t.find(s, pos); pos++;
			cnt++;
		}
		cout << cnt << " " << f << endl;
	}
	return 0;
 } 
